//
//  UIView+Extension.swift
//  CSYMicroBlockSina
//
//  Created by 姚彦兆 on 15/11/15.
//  Copyright © 2015年 姚彦兆. All rights reserved.
//

import UIKit

extension UIView {

    func getNavController() -> UINavigationController? {
        
        var nextResponse = self.nextResponder()
        
        repeat{
            
            if nextResponse is UINavigationController {
            
                return nextResponse as? UINavigationController
            
            }
            
            nextResponse = nextResponse?.nextResponder()
            
        }while (nextResponse != nil)
    
        return nil
        
    }

}
